/**Class Name: scheduleNMRReassignment 
 * Author: Accenture
 * Requirement/Project Name: NMR
 * Requirement Description: Class for Scheduling Reassignment of Leads
 */
global class scheduleNMRReassignment implements Schedulable{
        
    public static ID LocalAdsLeadRecordType = RecordTypeHelper.GetRecordTypeID('Lead', 'NMR Lead');
    public static ID leadWithCustIdRecordType = RecordTypeHelper.GetRecordTypeID('Lead', 'NMR Lead with CustomerId');
    global void execute(SchedulableContext sc) {
        
        NMRReassignmentLeadsBatch reassign = new NMRReassignmentLeadsBatch();//Instatiating the Reassign Batch
        reassign.RecId = LocalAdsLeadRecordType;
        reassign.secondRecId = leadWithCustIdRecordType;
        reassign.query = 'Select Id,status,OwnerId,PostalCode,Days_Untouched__c,Last_Worked__c,phone from Lead where (RecordtypeId =: RecId OR RecordtypeId =: secondRecId) AND Days_Untouched__c = 10';
        ID batchprocessid = Database.executeBatch(reassign,100);
    }
             
/* test class for classes/triggers */
 
  static testMethod void testscheduleNMRReassignment() {
        test.starttest();
        scheduleNMRReassignment ctrl = new scheduleNMRReassignment();
        String sch = '0 0 23 * * ?';
        system.schedule('Scheduled scheduleNMRReassignment', sch, ctrl);
        test.stopTest();
  }        
}